/**
 * SPDX-FileCopyrightText: 2023-2025 Sangfor Technologies Inc.
 * SPDX-License-Identifier: Mulan PSL v2
 */
/**
 * Created by hjh on 2017/7/1.
 */

/* eslint-disable no-magic-numbers */

/**
 * 获取内容高度
 * @param {Number} minHeight 最低高度
 * @returns {Number} 计算出来的内容高度
 * */
export default function getLimitBodyHeight (minHeight = 550) {
    const HEADER_HEIGHT = 62;
    const FOOTER_HEIGHT = 50;

    // 减去12是因为页面的内容主体div与页面头部设置了12px的margin-top
    const MARGIN_TOP = 12;

    return Math.max(window.innerHeight - HEADER_HEIGHT - FOOTER_HEIGHT - MARGIN_TOP, minHeight);
};
